home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er Special 83
/
64er_Magazin_Sonderheft_83_19xx_Markt__Technik_de_Side_A.d64
/
ultraboot maker+
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
7KB
|
233 lines
1000 rem *** ultraboot maker
1010 poke 53280,6:poke 53281,6
1020 poke 55,0:poke 56,37:clr
1030 dim m%(5,20),mf%(9),me%(9):mf%(0)=999
1040 print "[147][154] *** [213]ltraboot [205]aker ***"
1050 print "* (c) 1992 [205]artin [208]fost"
1060 print " *** maximale [198]ilelaenge : 104 [194]loecke"
1070 print:print "[213]ltraboot [205]aker erstellt auf [196]iskette"
1080 print "ein [213]-[198]ile, was sehr schnell ein be -"
1090 print "stimmtes [208]rogramm laedt ."
1100 print
1110 rem *** file laden
1120 print " *** [208]rogramm laden"
1130 input "==> [208]rogrammname = ";n$
1140 print "==> [196]iskette mit '";n$;"' einlegen !"
1150 get a$:if a$="" then 1150
1160 open 1,8,15,"i":gosub 2610
1170 open 2,8,0,n$:gosub 2610
1180 print " '";n$;"' wird gelesen ."
1190 get#2,a$,a$
1200 for i=53120 to 53212
1210 read d:c=c+d:poke i,d
1220 next i
1230 if c-12129 then print "??? [196]ata-[198]ehler !":goto 2550
1240 sys 53120
1250 ea=peek(174)+256*peek(175)+1
1260 bl=int((ea-9474)/254)+1
1270 print " [194]loecke : ";bl
1280 print " [194]ytes :";ea-9473
1290 if bl>104 then print "??? [198]ile zu lang !":goto 2550
1300 close 2
1301 open 2,8,2,n$+"+":i=0
1302 input#1,e:if e then 1309
1303 print " *** [213]ltraboot [205]enue-[198]ile !"
1304 input#2,mf%(i),me%(i):i=i+1
1305 if st=0 then 1304
1309 close 2
1310 print "==> [196]iskette, die [213]ltraboot erhalten"
1320 print " soll, einlegen !"
1330 get a$:if a$="" then 1330
1340 open 2,8,2,"#1":gosub 2610
1350 rem *** formatieren
1360 print " *** [198]ormatierung"
1370 gosub 2760
1380 t=36:i=0
1390 de=0:gs=17:sd=5
1400 if bl>84 then de=32:gs=18:sd=5
1410 if bl>89 then de=64:gs=19:sd=5
1420 if bl>94 then de=96:gs=21:sd=6
1430 print#2,chr$(de)+chr$(gs);
1440 print " [211]ektoren pro [212]rack :";gs
1450 print#1,"m-e"+chr$(23)+chr$(4)+chr$(t);
1460 print " [212]rack";t;"wird formatiert .[145]"
1470 gosub 2610
1480 i=i+gs:if i>bl then 1500
1490 t=t+1:goto 1450
1500 print " [198]ormatierung abgeschlossen ."
1510 print " *** [197]intrag im [196]irectory"
1520 print " [197]in freier [208]latz im [196]irectory wird"
1530 print " gesucht ."
1540 rem *** freie bloecke finden
1550 print#1,"u1 2 0 18 0":gosub 2610
1560 print#1,"b-p 2 73"
1570 get#2,a$:if a$="" then a$=chr$(0)
1580 i=0
1590 if (asc(a$) and 2^i) = 0 then m%(0,s)=1
1600 s=s+1:if s>18 then 1640
1610 i=i+1: if i<8 then 1590
1620 goto 1570
1630 rem *** freien eintrag finden
1640 s=1
1650 print#1,"u1 2 0 18";s:gosub 2610
1660 i=2
1670 print#1,"b-p 2";i
1680 get#2,a$:if a$="" then 1730
1690 i=i+32:if i<227 then 1670
1700 print#1,"b-p 2 1"
1710 get#2,a$:if a$<>chr$(255) then s=asc(a$):goto 1650
1720 ns=s+3:i=0:gosub 2670
1730 nd=ns:ns=18:gosub 2670
1740 print#1,"b-a:0 18";ns
1750 if i then 1870
1760 rem *** neuer dir-block
1770 print#1,"b-a:0 18";nd
1780 print#1,"b-p 2 0"
1790 print#2,chr$(18)+chr$(nd);
1800 print#1,"u2 2 0 18";s:gosub 2610
1810 for i=0 to 254
1820 print#2,chr$(0);
1830 next i
1840 print#2,chr$(255);
1850 i=2:s=nd
1860 rem *** file eintragen
1870 print#1,"b-p 2";i
1880 print#2,chr$(130);
1890 print#2,chr$(18)+chr$(ns);
1900 print#2,"u"+chr$(160);
1910 print#2,left$(n$+" ",14);
1920 for j=19 to 29
1930 print#2,chr$(0);
1940 next j
1950 print#1,"u2 2 0 18";s:gosub 2610
1960 print " [196]as [213]-[198]ile ist eingetragen in :"
1970 print " [212]rack : 18"
1980 print " [211]ektor :";s
1990 print " [197]intrag :";int(i/32)+1
2000 rem *** u-file schreiben
2010 print " *** [213]-[198]ile schreiben"
2020 gosub 2760
2030 print#2,chr$(de)+chr$(gs);
2040 close 2
2050 open 2,8,2,"#0":gosub 2610
2060 gosub 2760
2070 print#1,"b-p 2 207":print#2,chr$(de);
2080 print " [196]as [213]-[198]ile und [194]ootprogramm wird"
2090 print " geschrieben in :"
2100 print " [212]rack : 18"
2110 print " [211]ektor :";ns
2120 print#1,"u2 2 0 18";ns:gosub 2610
2130 print " [202]etzt wird das [196]iskettenbootprogramm"
2140 print " und '";n$;"' geschrieben ."
2150 rem *** block 36/0 schreiben
2160 gosub 2760
2170 print#1,"b-p 2 10"
2180 print#2,chr$(de);
2190 t=36:s=0:i=0:m%(1,0)=1
2200 poke 174,1:poke 175,37
2210 print#1,"b-p 2 254"
2215 bz=0
2220 goto 2400
2230 rem *** programm schreiben
2240 print#1,"b-p 2 0"
2250 sys 53175
2260 ad=peek(174)+256*peek(175)
2270 if ad<ea then 2400
2280 a=ea-9474-254*int((ea-9473)/254)
2290 e=0:if (a and 128)=0 then e=1
2300 if (a and 64)=0 then e=e+4
2310 if (a and 32)=0 then e=e+2
2320 if (a and 16)=0 then e=e+8
2330 if (a and 8)=0 then e=e+16
2340 if (a and 4)=0 then e=e+64
2350 if (a and 2)=0 then e=e+32
2360 if (a and 1)=0 then e=e+128
2370 print#2,chr$(e);chr$(0);
2380 goto 2480
2390 rem *** freien block finden
2400 ns=s+sd:nt=t:c=gs
2410 ns=ns+1:if ns>=gs then ns=ns-gs
2420 if m%(nt-35,ns)=0 then 2450
2430 c=c-1:if c>0 then 2410
2440 nt=nt+1:goto 2420
2450 m%(nt-35,ns)=1
2460 rem *** block schreiben
2461 i=0
2462 if mf%(i)>bz then 2470
2463 if mf%(i)=bz then a=me%(i):goto 2290
2464 i=i+1:goto 2462
2470 print#2,chr$(ns)+chr$(nt);
2480 print#1,"m-e"+chr$(36)+chr$(4)+chr$(t)+chr$(s);
2490 print " [212]rack :";t;" [211]ektor :";s;"[157] [145]"
2500 gosub 2610
2510 t=nt:s=ns
2515 bz=bz+1
2520 if ad<ea then 2240
2530 print:print " ";n$;" befindet sich auf [196]iskette ."
2540 print " [218]um [211]tarten '[213]' absolut laden ."
2550 print#1,"i"
2560 close 2:close 1
2570 poke 56,160:clr
2580 end
2590 :
2600 rem *** diskstatus testen
2610 input#1,e,e$,et,es
2620 if e=0 then return
2630 print:print "??? [196]isk-[198]ehler !"
2640 print " ";e;e$;et;es
2650 goto 2550
2660 rem *** block im dir. finden
2670 c=18
2680 if ns>18 then ns=ns-18
2690 if m%(0,ns)=0 then 2730
2700 ns=ns+1:c=c-1:if c then 2680
2710 print "??? [203]ein [194]lock mehr frei !"
2720 goto 2550
2730 m%(0,ns)=1
2740 return
2750 rem *** daten lesen
2760 c=0:print#1,"b-p 2 0"
2770 read d:if d>-1 then c=c+d:print#2,chr$(d);:goto 2770
2780 if d+c=0 then return
2790 print "??? [196]ata-[198]ehler !"
2800 print " falsche [208]ruefsumme :";d
2810 goto 2550
2820 :
2830 rem *** loadsaveroutinen
2840 data 162,2,32,198,255,160,0,132,174,169,37,133,175,32,207,255,133,4,169,0
2850 data 162,7,70,4,176,3,29,175,207,202,16,246,230,174,208,2,230,175,145,174
2860 data 165,144,240,225,76,204,255,1,4,2,8,16,64,32,128,169,54,133,1,162,2,32
2870 data 201,255,160,0,177,174,32,210,255,200,192,254,144,246,165,174,105,253
2880 data 133,174,144,2,230,175,169,55,133,1,76,204,255
2890 rem *** formatierroutine
2900 data 165,8,133,81,173,65,4,133,67,173,0,28,41,159,13,64,4,141,0,28,76,0
2910 data 251,32,0,193,162,1,169,10,141,32,6,169,160,141,33,6,169,15,141,34,6
2920 data 172,5,2,132,8,169,224,133,1,165,1,48,252,201,2,176,1,96,76,10,230
2930 data -5531
2940 rem *** writeroutine
2950 data 169,3,133,49,173,0,28,41,159,13,61,4,141,0,28,173,62,4,133,67,165,1
2960 data 41,2,208,3,76,152,246,169,208,133,1,76,117,245,32,24,193,173,5,2,133
2970 data 8,173,6,2,133,9,169,226,162,1,134,249,32,125,213,76,153,213,-5930
2980 rem *** u-file track 18
2990 data 0,196,36,3,52,3,202,241,237,246,62,241,47,243,102,254,165,244,237,245
3000 data 169,8,162,226,32,177,255,169,111,32,147,255,189,229,2,32,168,255,232
3010 data 208,247,32,174,255,173,17,208,41,239,141,17,208,120,169,32,141,0,221
3020 data 169,1,133,45,169,8,133,46,160,0,169,0,141,0,221,44,0,221,48,251,162
3030 data 32,234,44,0,221,48,2,38,255,173,0,221,74,74,13,0,221,74,74,13,0,221
3040 data 74,74,13,0,221,142,0,221,145,45,200,208,210,201,255,240,12,165,45,105
3050 data 254,133,45,144,198,230,46,208,194,160,254,177,45,101,45,133,45,144,2
3060 data 230,46,169,199,141,0,221,173,17,208,9,16,141,17,208,88,32,21,253,169
3070 data 0,32,113,168,76,174,167,77,45,69,5,2,238,13,2,238,20,2,174,73,2,224
3080 data 44,208,243,189,197,2,157,0,4,202,16,247,76,17,4,169,3,133,49,173,0,28
3090 data 41,159,9,0,141,0,28,76,209,244,169,36,133,8,74,141,5,28,162,0,134,9
3100 data 232,134,249,169,224,32,125,213,32,153,213,76,17,3,-27947
3110 rem *** leseroutine 36/0
3120 data 169,4,133,49,173,0,28,41,159,9,0,141,0,28,76,209,244,169,8,133,8,141
3130 data 0,24,172,255,3,173,254,3,132,6,133,7,169,224,162,0,134,249,32,125,213
3140 data 32,24,193,32,153,213,120,160,0,173,0,24,74,176,250,185,0,4,162,10,142
3150 data 0,24,74,74,74,74,166,8,142,0,24,141,0,24,10,41,15,141,0,24,185,0,4,41
3160 data 15,141,0,24,10,41,15,141,0,24,234,169,8,141,0,24,200,208,201,173,254
3170 data 4,172,255,4,208,171,169,18,133,6,169,176,88,133,0,165,0,48,252,76,231
3180 data 235,-12541
3190 rem *** ende